<script setup lang="ts">
import { ref } from "vue";
// 抛出方法
defineExpose({ changeMessage });
// 接收值 并定义类型
const props = defineProps<{
    text1: String;
    modelValue: String;
}>();
const emit = defineEmits<{
    "update:modelValue": [value: string];
    'emitChange': [value: string];
}>();
const message = ref("Hello from Vue 3.3 component!");

function changeMessage() {
    message.value = "welcome Your";
}
const emitChange = () => {
    emit("emitChange", "修改了text1的值,emit");
};
const emitUpdate = () => {
    emit("update:modelValue", "update");
};
</script>

<template>
    <h1 v-copy="message">{{ message }}</h1>
    <h1 v-copy="text1" @click="emitChange">{{ text1 }}</h1>
    <h1 v-copy @click="emitUpdate">{{ modelValue }}</h1>
</template>

<style scoped></style>
